package easing {

	public class Quad {
		public static function easeIn(time:uint, before:Number, change:Number, duration:uint):Number {
			var ratio:Number = time / duration;
			return change * ratio * ratio + before;
		}
		
		public static function easeOut(time:uint, before:Number, change:Number, duration:uint):Number {
			var ratio:Number = time / duration;
			return -change * ratio * (ratio - 2) + before;
		}
		
		public static function easeInOut(time:uint, before:Number, change:Number, duration:uint):Number {
			var ratio:Number = time / duration * 2;
			if (ratio < 1) {
				return change / 2 * ratio * ratio + before;
			}
			
			return -change / 2 * ((--ratio) * (ratio - 2) - 1) + before;
		}		
	}
}
